home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-10-26 | 426 b | 22 lines | [TEXT/ScoM] |
- HOW TO FIND 2 LAST SYMBOLS2
-
- >The question: how do I find the last 2 symbols in the zone? the last 3? or the
- >3 symbols prior to the last 2 symbols in a zone?
-
- (subseq '(a b c d e) 0 1)
- --> (a)
-
- (let ((list '(a b c d e)))
- (subseq list 2 (length list)))
- --> (c d e)
-
- (defun last-n (n l)
- (let ((maxlen (length l)))
- (subseq l (- maxlen n) maxlen)))
-
- (last-n 3 '(a b c d e))
- --> (c d e)
-
- (last-n 2 '(a b c d e))
- --> (d e)
-